package springboot.p1.javaconfig;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description: 配置类
 * @author: lzp
 * @createTime: 2021-08-25 23:16
 **/
//@Configuration
public class JavaConfig {

    @Bean
    public FunctionService functionService() {
        return new FunctionService();
    }

    @Bean
    public UserFunctionService userFunctionService() {
        UserFunctionService service = new UserFunctionService();
        service.setFunctionService(functionService());
        return service;
    }

    /**
     * 作为参数注入
     */
//    @Bean
//    public UserFunctionService userFunctionService(FunctionService functionService) {
//        UserFunctionService service = new UserFunctionService();
//        service.setFunctionService(functionService);
//        return service;
//    }
}
